<%@page import="java.util.List"%>
<%@page import="com.situ.company.employee.model.EmployeeModel"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/web/header.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>  
<title>主界面</title>
</head>
<body>
 <div class="layui-layout layui-layout-admin">
     <div class="layui-header">
         <div class="layui-logo layui-hide-xs layui-bg-black">绩效管理</div>
         <!-- 头部区域（可配合layui 已有的水平导航） -->
         <ul class="layui-nav layui-layout-right">
             <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                 <a href="javascript:;" id='headPic'>
                 </a>
                 <dl class="layui-nav-child">
                     <dd><a href="javascript:openLayer('/web/page/employee/upd.jsp?code=' + code,init);">修改资料</a></dd>
                     <dd><a href="javascript:openLayer('/web/page/employee/updPass.jsp?code=' + code,init);">修改密码</a></dd>
                     <dd><a href="javascript:openLayer('/web/page/employee/updImg.jsp?code=' + code,init);">上传头像</a></dd>
                 </dl>
             </li>
             <li class="layui-nav-item">
                 <a href="javascript:goLogout()">注销</a>
             </li>
         </ul>
     </div>

     <div class="layui-side layui-bg-black">
         <div class="layui-side-scroll">
             <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
             <ul class="layui-nav layui-nav-tree">
                 <li class="layui-nav-item layui-nav-itemed">
                     <a class="" href="javascript:;">信息维护</a>
                     <dl class="layui-nav-child">
                         <dd><a href="javascript:;" class="site-demo-active"
                            data-url="/web/page/department/list.jsp">部门信息维护</a></dd>
                         <dd><a href="javascript:;" class="site-demo-active"
                            data-url="/web/page/employee/list.jsp">员工信息维护</a></dd>
                         <dd><a href="javascript:;" class="site-demo-active"
                            data-url="/web/page/department.jsp">项目信息维护</a></dd>
                         <dd><a href="javascript:;" class="site-demo-active"
                            data-url="/web/page/department.jsp">绩效信息维护</a></dd>
                     </dl>
                 </li>
                 <li class="layui-nav-item">
                    <a href="javascript:;">基本配置</a>
                     <dl class="layui-nav-child">
                         <dd><a href="javascript:;" class="site-demo-active"
                            data-url="/web/404.html">其他一</a></dd>
                         <dd><a href="javascript:;">其他二</a></dd>
                     </dl>
                 </li>
             </ul>
         </div>
     </div>
     
     <div class="layui-body">
         <iframe name='rightiframe' style="width: 99%; height: 97%"></iframe>
     </div>

     <div class="layui-footer">
                            底部区域 : 固定区域
     </div>
 </div>
 
 <script type="text/javascript">
<% List<EmployeeModel> list =(List<EmployeeModel>) session.getAttribute("user");%>
var code = <%=list.get(0).getCode()%>

 $('.site-demo-active').click(function(){
     window.open(base.app + $(this).data("url"),"rightiframe");
 })
 
 $('.site-demo-active:first').click();
 
 function goLogout(){
     location.href="<%=app%>/web/login.jsp";
 }
 
 init();
 function init(){
     ajax('/employee',{action:'get',code:code}, 'json', function(data){
         var image = data.image;
         if(image){
             $("#headPic").html("<img src='/images/" + image + "' class='layui-nav-img'>");
         }
         else $("#headPic").html("<img src='/images/Cat.jpg' class='layui-nav-img'>");
     });
 }
</script>
 
</body>
</html>